#!/bin/bash

params=$@

[ $# -eq 0 ] && { echo "$0: 请输入需要升级的版本号" ; echo "Usage: $0 1.5.0-SNAPSHOT[1.5.0]" ; exit 1 ; }

echo "-----------------------------------------"
echo "开始pull 最新代码"
echo "-----------------------------------------"

sh ./gpl.sh all

echo "-----------------------------------------"
echo "开始替换版本为: $params"
echo "-----------------------------------------"

mvn versions:set -DnewVersion=$params
mvn versions:commit

echo "-----------------------------------------"
echo "开始打包部署到私有仓库"
echo "-----------------------------------------"

mvn clean deploy -U -Dmaven.test.skip=true

echo "-----------------------------------------"
echo "打包完成，开始提交到git"
echo "-----------------------------------------"

sh ./gps.sh all="提交release版本${params}"


echo "-----------------------------------------"
echo "提交完成"
echo "-----------------------------------------"



